program basic;
{*编译器指令*}

uses
{添加引用的单元}
	crt, sysutils;

{记录类型}
type TCar=record
	ModelName: WideString;
	Engine: String;
	Year: Integer;
end	;



var  {定义变量}
	{整数}
	i: Integer;	   		{-2147483648,2147483647}
	ib: Byte; 			{0,255}
	ish: Shortint;		{-128,127}
	ism: Smallint;		{-32768,32767}
	iw: Word;			{0,65535}
	ili: Longint;		{-2147483648,2147483647}
	ic: Cardinal;		{0,4294967295}
	i64: Int64;			{-9223372036854775808,9223372036854775807}

	c: Char;	{字符}
	str: String; {字符串  freepascal字符串最大256}
	s: Single;  {实数}


	iarr: array[2..10] of Integer; 

	car: TCar;
begin

		
	writeln('hello world，我是中国人。');
	{
	TextBackground(Red);
	TextColor(White);
	ClrScr;	
	GoToXY(10, 5);
	}

	writeln('Integer size:', Sizeof(i), ' Minimum value:', Low(i), ' Maximum value:', High(i));
	writeln('Byte size:', Sizeof(ib), ' Minimum value:', Low(ib), ' Maximum value:', High(ib));
	writeln('Shortint size:', Sizeof(ish), ' Minimum value:', Low(ish), ' Maximum value:', High(ish));
	writeln('Smallint size:', Sizeof(ism), ' Minimum value:', Low(ism), ' Maximum value:', High(ism));
	writeln('Word size:', Sizeof(iw), ' Minimum value:', Low(iw), ' Maximum value:', High(iw));
	writeln('Longint size:', Sizeof(ili), ' Minimum value:', Low(ili), ' Maximum value:', High(ili));
	writeln('Cardinal size:', Sizeof(ic), ' Minimum value:', Low(ic), ' Maximum value:', High(ic));
	writeln('Int64 size:', Sizeof(i64), ' Minimum value:', Low(i64), ' Maximum value:', High(i64));

	writeln('Char size:', Sizeof(c), ' Minimum value:', Low(c), ' Maximum value:', High(c));
	writeln('String size:', Sizeof(str), ' Minimum value:', Low(str), ' Maximum value:', High(str));
	{writeln('Single size:', Sizeof(s), ' Minimum value:', Low(s), ' Maximum value:', High(s));}

	str := '22';


	i := 0;
	case i of 
		0 : begin 
				writeln('i=', 0);
				writeln('after');
			end;
		1 : begin
				writeln('i=', 1);
				writeln('after');
			end;
	end;

	(*
	{循环}
	for i:= 1 to 10 do 
	begin
		writeln('for ', i);
	end;

	while i > 0 do
	begin
		writeln('while ', i);
		i := i - 1;
	end;

	repeat
		writeln('repeat ', i);
		i := i + 1;
	until i > 10 ;

	for i:=0 to 11 do 
	begin
		iarr[i] := i;
		writeln('array[', i, ']=', i);
	end;
	*)

	{记录类型}
	car.ModelName := '轿车';
	car.Engine := '前驱四缸';
	car.Year:= 2024;

	writeln('record type:', car.ModelName);

	{
	Sound(1000);
	Delay(1000);
	NoSound();
	}

	Write('press any key to close.');
	Readln();
end.